﻿@using Pyramid.Mvc.Html
@model Pyramid.Models.ConsumeRecord

<div class="pageContent">
	@using (Html.BeginForm("EditRecord", "Consume", FormMethod.Post, new {@class = "pageForm required-validate", onsubmit = "return validateCallback(this, navTabAjaxDone);"}))
	{
		<div class="pageFormContent" layouth="56">
			@Html.HiddenFor(x => x.Id)
			@Html.HiddenFor(x => x.ConsumeItemId)
			@Html.HiddenFor(x => x.CustomerId)
			<dl class="nowrap">
				<dt>@Html.LabelFor(m => m.Customer.FullName)</dt>
				<dd>
					@Html.TextBox("CustomerName", Model.Customer == null ? "" : Model.Customer.FullName, new {@class = "required", @readonly = "readonly"})
					@Html.ActionLink("选择顾客", "SelectList2", "Customer", null, new {@class = "btnLook", lookupGroup = ""})
					<span class="info">（选择顾客）</span>
				</dd>
			</dl>
			<dl class="nowrap">
				<dt>@Html.LabelFor(m => m.ConsumeItem.ItemName)</dt>
				<dd>
					@Html.TextBox("ConsumeItemName", Model.ConsumeItem == null ? "" : Model.ConsumeItem.ItemName, new {@class = "required", @readonly = "readonly"})
					@Html.ActionLink("选择消费项目", "SelectList", "ConsumeItem", null, new {@class = "btnLook", lookupGroup = ""})
					<span class="info">（选择消费项目）</span>
				</dd>
			</dl>
			<p class="nowrap">
				@Html.LabelFor(m => m.ConsumeItem.MarketPrice)
				@Html.TextBox("ConsumeItemMarketPrice",Model.ConsumeItem==null?"":Model.ConsumeItem.MarketPrice.ToString("C"), new {@readonly = "readonly"})
			</p>
			<p class="nowrap">
				@Html.LabelFor(m => m.ConsumeItem.VipPrice)
				@Html.TextBox("ConsumeItemVipPrice",Model.ConsumeItem==null?"":Model.ConsumeItem.VipPrice.ToString("C"), new {@readonly = "readonly"})
			</p>
			<p class="nowrap">
				@Html.LabelFor(m => m.ActualPrice)
				@Html.TextBoxFor(m => m.ActualPrice, new {@class = "required number"})
			</p>
			<p class="nowrap">
				@Html.LabelFor(m => m.Remark)
				@Html.TextAreaFor(m => m.Remark)
			</p>
			<div class="divider"></div>
			<p>
				@Html.LabelFor(model => model.CreateUserId)
				@Html.ReadonlyFieldFor(model => model.CreateUserId)
			</p>
			<p>
				@Html.LabelFor(model => model.CreateTime)
				@Html.ReadonlyDateTimeFor(model => model.CreateTime)
			</p>
			<p>
				@Html.LabelFor(model => model.EditUserId)
				@Html.ReadonlyFieldFor(model => model.EditUserId)
			</p>
			<p>
				@Html.LabelFor(model => model.EditTime)
				@Html.ReadonlyDateTimeFor(model => model.EditTime)
			</p>
		</div>
		<div class="formBar">
			<ul>
				<li>
					<div class="buttonActive">
						<div class="buttonContent">
							<button type="submit">保存</button>
						</div>
					</div>
				</li>
				<li>
					<div class="button">
						<div class="buttonContent">
							<button type="button" class="close">取消</button>
						</div>
					</div>
				</li>
			</ul>
		</div>
	}
</div>
